from django.db import models
from user.models import UserProfile
from video.models import Videos


# Create your models here.
class Play(models.Model):
    pid = models.BigAutoField(primary_key=True)
    user = models.ForeignKey(UserProfile, on_delete=models.CASCADE, related_name='user')
    video = models.ForeignKey(Videos, on_delete=models.CASCADE, related_name='video')
    time = models.DateTimeField(auto_now=True)
    count = models.IntegerField(default=1)
    progress = models.FloatField(default=0)
